package com.zmn.oms.model.entity.part;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.zmn.oms.model.entity.work.OrderBaseEsQuery;
import com.zmn.oms.model.es.ZmnEsFieldType;
import com.zmn.oms.model.es.ZmnToEs;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

/**
 * 类描述： 查询工单配件
 *
 * @author lujia
 * @date 2018/11/23 20:01
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class OrderPartEsQuery extends OrderBaseEsQuery {

    /**
     * 公司Id
     */
    @ZmnToEs(map = "companyId", type = ZmnEsFieldType.Integer)
    private Integer companyId;

    /**
     * 工单城市
     */
    @ZmnToEs(map = "cityId", type = ZmnEsFieldType.Integer)
    private Integer cityId;

    /**
     * 工单城市
     */
    @ZmnToEs(map = "cityId", type = ZmnEsFieldType.Arr)
    private List<Integer> cityIdList;

    /**
     * 工程师Id
     */
    @ZmnToEs(map = "masterId", type = ZmnEsFieldType.Integer)
    private Integer masterId;

    /**
     * 工单号code
     */
    @ZmnToEs(map = "orderId", type = ZmnEsFieldType.Long)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long code;

    /**
     * 工单号后六位
     */
    @ZmnToEs(map = "codeEnd6", type = ZmnEsFieldType.Text)
    private String codeEnd6;

    /**
     * 配件类型
     */
    @ZmnToEs(map = "partType", type = ZmnEsFieldType.Integer)
    private Integer partType;

    /**
     * 配件Id
     */
    @ZmnToEs(map = "partId", type = ZmnEsFieldType.Integer)
    private String partId;

    /**
     * 配件名称匹配
     */
    @ZmnToEs(map = "partName", type = ZmnEsFieldType.Match)
    private String partName;

    /**
     * 配件一级分类id
     */
    @ZmnToEs(map = "categOneId", type = ZmnEsFieldType.Integer)
    private Integer categOneId;

    /**
     * 配件分类id
     */
    @ZmnToEs(map = "categId", type = ZmnEsFieldType.Integer)
    private Integer categId;

    /**
     * 配件报销状态
     */
    @ZmnToEs(map = "reimburseStatus", type = ZmnEsFieldType.Integer)
    private Integer reimburseStatus;

    /**
     * 算账时间 startTime,endTime
     */
    @ZmnToEs(map = "accountTime", type = ZmnEsFieldType.Date)
    private String accountTime;

    /**
     * 配件报销时间 startTime,endTime
     */
    @ZmnToEs(map = "reimburseTime", type = ZmnEsFieldType.Date)
    private String partReimburseTime;
}
